Add Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Adds a new item to the bag. Since bags can contain duplicate items, the item is added even if the bag already contains an item equal to item. In this case, the count of items for the representative item is increased by one, but the existing represetative item is unchanged.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public void Add(
	T item
)
Visual Basic (Declaration)
Public Sub Add ( _
	item As T _
)
Visual C++
public:
virtual void Add (
	T item
) sealed

Parameters

item
T
The item to add to the bag.

Remarks

Adding an item takes approximately constant time, regardless of the number of items in the bag.

See Also